<?php

namespace App\Http\Requests;

use Illuminate\Contracts\Validation\Validator;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Exceptions\HttpResponseException;

class BasicRequest extends FormRequest
{
    // 自定义错误响应
    protected function failedValidation(Validator $validator)
    {
        throw new HttpResponseException(c_return(-1,$validator->errors()->all()[0]));
    }
}
